﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace 获取主机名
{
    class Program
    {
        static void Main(string[] args)
        {
            string d = Dns.GetHostEntry("localhost").HostName;
            Console.WriteLine("主机名：" + d);
            Console.ReadKey();
        }
    }
}
